#define _CRT_SECURE_NO_WARNINGS 1
#include "Online Courses Selecting System.h"

void menu()
{
	printf("**********************************\n");
	printf("**********学生选课系统************\n");
	printf("**********************************\n");
	printf("*********1.学生信息的录入*********\n");
	printf("*********2.查找学生信息***********\n");
	printf("*********3.删除学生信息***********\n");
	printf("*********4.打印学生信息***********\n");
	printf("*********5.保存学生信息***********\n");
	printf("**********************************\n");
}


int main()
{
	int n = 0;
	Student s;
	Student* ps = &s;
	while (1)
	{
		menu();
		int id = 0;
		scanf("%d", &n);
		switch (n)
		{
		case 1:
			scanf("%d %s %d %s %d %d", &(s.ID), (char*)s.name, &(s.CourseNum), (char*)s.CourseName, &(s.Hours), &(s.Score));
			push(&ps, s.ID, s.name, s.CourseNum, s.CourseName, s.Hours, s.Score);
			break;
		case 2:
			scanf("%d", &id);
			FindByID(ps, id);
			break;
		case 3:
			scanf("%d", &id);
			delete(&ps, id);
		case 4:
			Browse();
			break;
		case 5:
			Saveinformation(ps);
			break;
		case 6:
			printf("退出系统！");
			exit(0);
		default:
			printf("非法输入，请重新输入：");
			break;
		}
	}

	//Student* s = NULL;
	//push(&s, 0270, "C++", 32, 6, 1, "张三");
	//push(&s, 0270, "C++", 32, 6, 2, "李四");
	//push(&s, 0270, "C++", 32, 6, 3, "王五");
	//push(&s, 0270, "C++", 32, 6, 4, "赵六");
	////print(s);

	////FindByID(s, 1);
	////FindByID(s, 2);
	////FindByID(s, 3);
	////FindByID(s, 4);
	////FindByID(s, 8);
	////学生信息的删除
	////delete(&s,3);
	////delete(&s,2);
	////delete(&s,1);
	////print(s);


	//Saveinformation(s);
	//Destroy(&s);

	//push(&s, 134, "java", 16, 5, 10,"萧炎");

	//Saveinformation(s);

	//Student* s = NULL;

	//Browse()；
	return 0;
}